From: Florian Müllner Date: Thu, 10 Apr 2025 18:22:22 +0000 (+0200) Subject: calendar: Remove do-not-disturb switch X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~124^2^2~12 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=254fbbb36e5cc7cfea7ea58bd1fe930ee428432c;p=gnome-shell.git calendar: Remove do-not-disturb switch While clearly related to notifications, having it in the already quite crowded date/notification popover is quite awkward. Also the canonical place for quickly accessing commonly used settings is the quick settings menu nowadays. So remove the existing control from the calendar menu before re-adding the feature as quick toggle. Part-of: --- diff --git a/data/theme/gnome-shell-sass/widgets/_message-list.scss b/data/theme/gnome-shell-sass/widgets/_message-list.scss index 2b289b47f..65e328fbb 100644 --- a/data/theme/gnome-shell-sass/widgets/_message-list.scss +++ b/data/theme/gnome-shell-sass/widgets/_message-list.scss @@ -46,20 +46,6 @@ padding-bottom: $base_padding; spacing: $base_padding; @extend %heading; - - .dnd-button { - // We need this because the focus outline isn't inset like for the buttons - // so the dnd button would grow when it gets focus if we didn't change only - // its color when focusing. - border-width: 2px; - border-color: transparent; - border-radius: 32px; - border-style: solid; - - &:focus { - border-color: st-transparentize(-st-accent-color, 0.4); - } - } } // message notification group diff --git a/js/ui/calendar.js b/js/ui/calendar.js index c0610ba6f..936854c5a 100644 --- a/js/ui/calendar.js +++ b/js/ui/calendar.js @@ -6,7 +6,6 @@ import Shell from 'gi://Shell'; import St from 'gi://St'; import * as MessageList from './messageList.js'; -import * as PopupMenu from './popupMenu.js'; import {ensureActorVisibleInScrollView} from '../misc/animationUtils.js'; import {formatDateWithCFormatString} from '../misc/dateUtils.js'; @@ -776,26 +775,6 @@ class Placeholder extends St.BoxLayout { } }); -const DoNotDisturbSwitch = GObject.registerClass( -class DoNotDisturbSwitch extends PopupMenu.Switch { - _init() { - this._settings = new Gio.Settings({ - schema_id: 'org.gnome.desktop.notifications', - }); - - super._init(this._settings.get_boolean('show-banners')); - - this._settings.bind('show-banners', - this, 'state', - Gio.SettingsBindFlags.INVERT_BOOLEAN); - - this.connect('destroy', () => { - Gio.Settings.unbind(this, 'state'); - this._settings = null; - }); - } -}); - export const CalendarMessageList = GObject.registerClass( class CalendarMessageList extends St.Widget { constructor() { @@ -828,26 +807,6 @@ class CalendarMessageList extends St.Widget { let hbox = new St.BoxLayout({style_class: 'message-list-controls'}); box.add_child(hbox); - const dndLabel = new St.Label({ - text: _('Do Not Disturb'), - y_align: Clutter.ActorAlign.CENTER, - }); - hbox.add_child(dndLabel); - - this._dndSwitch = new DoNotDisturbSwitch(); - this._dndButton = new St.Button({ - style_class: 'dnd-button', - can_focus: true, - toggle_mode: true, - child: this._dndSwitch, - label_actor: dndLabel, - y_align: Clutter.ActorAlign.CENTER, - }); - this._dndSwitch.bind_property('state', - this._dndButton, 'checked', - GObject.BindingFlags.BIDIRECTIONAL | GObject.BindingFlags.SYNC_CREATE); - hbox.add_child(this._dndButton); - this._clearButton = new St.Button({ style_class: 'message-list-clear-button button', label: _('Clear'),